{extend name="../public/header" /}
{block name="body"}
<body>
{include file="../public/top" uname="$roleInfo.uname" lv="$roleInfo.ulv" ls="$roleInfo.uyxb" jp="$roleInfo.uczb" /}
<div class="subject main">
    <div class="layui-row">
        <div class="content">
            <div class="current">
                <span class="position">{$roleInfo.map.mname}</span>
                <span class="state">{if $roleInfo.map.ispvp==0}[安全区]{else/}[PVP]{/if}</span>
                <span class="info ajax-goto" data-url="{:url('home/index')}">返回</span>
            </div>
            <div class="refine">
                <div class="equip" style="background-color: white;padding: 10px;box-sizing: border-box;">
                    <div class="layui-row layui-col-space10 shop" style="border: #D5CBCB 1px solid;">
                        {volist name="list" id="vo"}
                        <div class="layui-col-xs4">
                            <div class="grid-demo {if $roleInfo.cw == $vo.cwid}layui-bg-red{/if} ajax-goto" data-url="{:url('info')}" data-field="str" data-value="{$vo.str}">{$vo.cwname}</div>
                        </div>
                        {/volist}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
    layui.use(['jquery', 'form', 'layajax', 'upload', 'flow', 'element'], function () {
        var $ = layui.jquery
            , layajax = layui.layajax
            , upload = layui.upload
            , element = layui.element
            , flow = layui.flow
            , form = layui.form;

        $('.ajax-act').on('click', function () {
            var obj = $(this);
            var id = obj.data('id');

            var url = '{:url("refineAct")}';
            console.log('url', url);

            var map = {};
            map['id'] = id;

            $.post(url, map, function (res) {
                if (res.code == undefined) {
                    console.log('res为json字符串', res);
                    res = JSON.parse(res);
                } else {
                    console.log('res为json对象', res);
                }
                layer.msg(res.msg,{time:1000}, function(index){
                    location.reload();
                });
            });
        });

        form.render();
    });
</script>
{/block}